#include "QNode.h"

QNode::QNode(int x1, int y1, int width, int height, int level, int id)
{
	this->x1 = x1;
	this->y1 = y1;
	this->x2 = this->x1 + width;
	this->y2 = this->y1 + height;
	this->level = level;
	this->id_node = id;

	this->size = width;

	this->left_top = NULL;
	this->right_top = NULL;
	this->left_bottom = NULL;
	this->right_bottom = NULL;


}

QNode::QNode(int x1, int y1, int size, int level, int id)
{
	this->x1 = x1;
	this->y1 = y1;
	this->x2 = this->x1 + size;
	this->y2 = this->y1 + size;
	this->level = level;
	this->id_node = id;
	this->size = size;

	this->left_top = NULL;
	this->right_top = NULL;
	this->left_bottom = NULL;
	this->right_bottom = NULL;
}


QNode::~QNode()
{
	delete this->left_top;
	delete this->right_top;
	delete this->left_bottom;
	delete this->right_bottom;
}

void QNode::addGameObject(Object *obj)
{
	obj_list.push_back(obj);
}

void QNode::addTilesBg(TilesObject *p_tiles)
{
	tilesBg_list.push_back(p_tiles);
}